package com.cy2;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class CopeJavaDemo2 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("myCharStream\\ConversionStreamDemo.java");
        FileWriter fw = new FileWriter("myCharStream\\Cope2.java");
        //一次读取一个字符
//        int ch;
//        while((ch=fr.read())!=-1){
//            fw.write(ch);
//        }
        //一次读取一个字符数组
        char[] bys = new char[1024];
        int len;
        while((len=fr.read(bys))!=-1){
            fw.write(bys,0,len);
        }

        fr.close();
        fw.close();
    }
}
